package models;

import java.util.Date;

import play.libs.OAuth.ServiceInfo;

import securesocial.provider.AuthenticationMethod;
import siena.*;

public class User extends Model
{
	@Id(Generator.AUTO_INCREMENT)
    public Long id;
	
	public String stringID;
    public String email;
	public String name;
//	public Date created;
//	public Date modified;

	public String provider;
	public Date lastAccess;
	public String avatarUrl;
	public String accessToken;

	public String authMethod;

	public boolean isEmailVerified;
	public String displayName;

	public String token;
	public String password;
	public String secret;

    static Query<User> all() {
        return Model.all(User.class);
    }

    public static User findById(String stringID) 
    {
        return all().filter("stringID", stringID).get();
    }

    public static User findByEmail(String email) {
        return all().filter("email", email).get();
    }
	public User() {
		super();
	}
    public User(String email) {
		this.email = email;
    }

    public String toString() {
        return email;
    }
}
